/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aiaudio.processing.reduce.klsh.kmeaning.hbase;

import java.io.IOException;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Result;

/**
 *
 * @author nastya
 */
public class TableRecordSource implements IRecordSource{

    private HTable table;
    private final long version;

    public TableRecordSource(HTable table, long version) {
        this.table = table;
        this.version = version;
    }
    
    @Override
    public Result getRecord(byte[] data) throws IOException {
        Get get = new Get(data);
        get.setTimeStamp(version);        
        return table.get(get);
    }
    
}
